﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;

namespace Client.Converters
{
    public class RadioButtonCheckedConverter : IValueConverter
    {
        private static RadioButtonCheckedConverter _instance;
        public static RadioButtonCheckedConverter Instance
        {
            get { return _instance ?? (_instance = new RadioButtonCheckedConverter()); }
        }
        
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (int)value == Int32.Parse(parameter.ToString());
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return parameter;
        }
    }
}
